<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Manage_log extends Admin_Controller {
	public function __construct(){
        parent::__construct();
	}
	
	public function index($page=''){
		$page_count=20;
		$sql='select * from ca_manage_log';
		$query=$this->db->query($sql);
		$row_count=$query->num_rows();
		$total_pages=ceil($row_count/$page_count);
		$page<1 && $page=1;
		$page>$total_pages && $page=1;
		$start_row=($page-1)*$page_count;
		$arr=explode('/',uri_string());
		$query_string=base_url($arr[0].'/index/');
		$turn_page = turn_page($page, $total_pages, $query_string, $row_count, '上一页', '下一页',3,'style="margin:0px; text-align:right;"');
		$query=$this->db->query($sql.' order by OpTime desc limit '.$start_row.','.$page_count);
		
		$data['query']=$query;
		$data['turn_page']=$turn_page;
		$this->load->view(THEME_PATH.'/manage_log/list.php',$data);
	}

}
?>